﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ADO
{
    class Program
    {
        static void Main(string[] args)
        {
            string joint = @"server=LAPTOP-AS39K086\MSSQLSERVER1;database=text;uid=HUANG;pwd=571193002";
            SqlConnection sqlConnection = new SqlConnection(joint);
            sqlConnection.Open();
            string sql = "select * from H310";
            //SqlCommand sqlCommand = new SqlCommand(sql,sqlConnection);
            //var show = sqlCommand.ExecuteReader();
            //while (show.Read()) {
            //    Console.WriteLine("{0},{1}",show[1],show[2]);
            //}

            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sql,sqlConnection);
            DataSet dataSet = new DataSet();
            sqlDataAdapter.Fill(dataSet);
            foreach (DataTable dataTable in dataSet.Tables) {
                foreach (DataRow dataRow in dataTable.Rows) {
                    foreach (DataColumn dataColumn in dataTable.Columns) {
                        Console.WriteLine(dataRow[dataColumn]+"\t");
                    }
                }
            }
        }
    }
}
